<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/hasFunc.hpp 文件参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">宏定义</a>  </div>
  <div class="headertitle"><div class="title">hasFunc.hpp 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p><a href="../../da/dfe/has_func_8hpp_source.html">浏览该文件的源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:acb70407ceffb90c01bcecbd411dae333" id="r_acb70407ceffb90c01bcecbd411dae333"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acb70407ceffb90c01bcecbd411dae333">DECLARE_FUNC_CHK</a>(funcName)</td></tr>
<tr class="memdesc:acb70407ceffb90c01bcecbd411dae333"><td class="mdescLeft">&#160;</td><td class="mdescRight">检查指定函数名字是否存在  <br /></td></tr>
<tr class="separator:acb70407ceffb90c01bcecbd411dae333"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfd8dd24a87516f740c8b1f272c41bb5" id="r_acfd8dd24a87516f740c8b1f272c41bb5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acfd8dd24a87516f740c8b1f272c41bb5">HAS_FUNC</a>(classType,  funcName)&#160;&#160;&#160;has_##funcName&lt; classType &gt;::value</td></tr>
<tr class="separator:acfd8dd24a87516f740c8b1f272c41bb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a4ddf390511ec61cf919020411183c3" id="r_a7a4ddf390511ec61cf919020411183c3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7a4ddf390511ec61cf919020411183c3">DECLARE_FUNC_CHK_1</a>(funcName,  paramType1)</td></tr>
<tr class="separator:a7a4ddf390511ec61cf919020411183c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5bff084e741484fa69d6d6a339ae754" id="r_ac5bff084e741484fa69d6d6a339ae754"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac5bff084e741484fa69d6d6a339ae754">HAS_FUNC_1</a>(classType,  funcName)&#160;&#160;&#160;has1_##funcName&lt; classType &gt;::value</td></tr>
<tr class="separator:ac5bff084e741484fa69d6d6a339ae754"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">宏定义说明</h2>
<a id="acb70407ceffb90c01bcecbd411dae333" name="acb70407ceffb90c01bcecbd411dae333"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb70407ceffb90c01bcecbd411dae333">&#9670;&#160;</a></span>DECLARE_FUNC_CHK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DECLARE_FUNC_CHK</td>
          <td>(</td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>funcName</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> <span class="keyword">class</span>Type &gt; \</div>
<div class="line"><span class="keyword">struct </span>has_ ## funcName{ \</div>
<div class="line">    template &lt;typename C, typename = decltype(std::declval&lt;C&gt;().funcName())&gt; \</div>
<div class="line">    <span class="keyword">static</span> std::true_type test(<span class="keywordtype">int</span>); \</div>
<div class="line">    \</div>
<div class="line">    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C&gt;  \</div>
<div class="line">    <span class="keyword">static</span> std::false_type test(...);  \</div>
<div class="line">    \</div>
<div class="line">    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> value = <span class="keyword">decltype</span>(test&lt; classType &gt;(0) )::value; \</div>
<div class="line">}</div>
</div><!-- fragment -->
<p>检查指定函数名字是否存在 </p>

<p class="definition">在文件 <a class="el" href="../../da/dfe/has_func_8hpp_source.html">hasFunc.hpp</a> 第 <a class="el" href="../../da/dfe/has_func_8hpp_source.html#l00007">7</a> 行定义.</p>

</div>
</div>
<a id="a7a4ddf390511ec61cf919020411183c3" name="a7a4ddf390511ec61cf919020411183c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a4ddf390511ec61cf919020411183c3">&#9670;&#160;</a></span>DECLARE_FUNC_CHK_1</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DECLARE_FUNC_CHK_1</td>
          <td>(</td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>funcName</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>paramType1</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> <span class="keyword">class</span>Type &gt; \</div>
<div class="line"><span class="keyword">struct </span>has1_ ## funcName{ \</div>
<div class="line">    template &lt;typename C, typename = decltype(std::declval&lt;C&gt;().funcName( *(paramType1*)<span class="keyword">nullptr</span>))&gt; \</div>
<div class="line">    <span class="keyword">static</span> std::true_type test(<span class="keywordtype">int</span>); \</div>
<div class="line">    \</div>
<div class="line">    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C&gt;  \</div>
<div class="line">    <span class="keyword">static</span> std::false_type test(...);  \</div>
<div class="line">    \</div>
<div class="line">    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> value = <span class="keyword">decltype</span>(test&lt; classType &gt;(0) )::value; \</div>
<div class="line">}</div>
</div><!-- fragment -->
<p class="definition">在文件 <a class="el" href="../../da/dfe/has_func_8hpp_source.html">hasFunc.hpp</a> 第 <a class="el" href="../../da/dfe/has_func_8hpp_source.html#l00021">21</a> 行定义.</p>

</div>
</div>
<a id="acfd8dd24a87516f740c8b1f272c41bb5" name="acfd8dd24a87516f740c8b1f272c41bb5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acfd8dd24a87516f740c8b1f272c41bb5">&#9670;&#160;</a></span>HAS_FUNC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HAS_FUNC</td>
          <td>(</td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>classType</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>funcName</em></span>&#160;)&#160;&#160;&#160;has_##funcName&lt; classType &gt;::value</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../da/dfe/has_func_8hpp_source.html">hasFunc.hpp</a> 第 <a class="el" href="../../da/dfe/has_func_8hpp_source.html#l00019">19</a> 行定义.</p>

</div>
</div>
<a id="ac5bff084e741484fa69d6d6a339ae754" name="ac5bff084e741484fa69d6d6a339ae754"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5bff084e741484fa69d6d6a339ae754">&#9670;&#160;</a></span>HAS_FUNC_1</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HAS_FUNC_1</td>
          <td>(</td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>classType</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>funcName</em></span>&#160;)&#160;&#160;&#160;has1_##funcName&lt; classType &gt;::value</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../da/dfe/has_func_8hpp_source.html">hasFunc.hpp</a> 第 <a class="el" href="../../da/dfe/has_func_8hpp_source.html#l00033">33</a> 行定义.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
